package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class 合法日期 {
	   static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	  
       public static void main(String[] args) throws IOException {
    	      int year=2021;
    	      String month=br.readLine();
    	      if(month.length()==1)month="0"+month;		  
    	      String day=br.readLine();
    	      if(day.length()==1)day="0"+day;
    	      String date=year+"-"+month+"-"+day;
    	      try{
    	    	  LocalDate ld=LocalDate.parse(date,DateTimeFormatter.ISO_LOCAL_DATE);
    	    	  System.out.print("yes");
    	      }catch(Exception e){
    	    	  System.out.print("no");
    	      }
		      
		      
	}
}
